<?php
// 考生答题表 migration
use think\migration\Migrator;
use Phinx\Db\Adapter\MysqlAdapter;

class ExamUserAnswer extends Migrator
{
    public function change()
    {
        $table = $this->table('exam_user_answer');
        $table->addColumn('user_paper_id', 'integer', ['default' => 0, 'comment' => '考生答卷ID'])
            ->addColumn('question_id', 'integer', ['default' => 0, 'comment' => '题目ID'])
            ->addColumn('type', 'string', ['limit' => 16, 'default' => '', 'comment' => '题型'])
            ->addColumn('answer', 'text', ['comment' => '考生答案'])
            ->addColumn('score', 'integer', ['default' => 0, 'comment' => '得分'])
            ->addColumn('is_reviewed', 'boolean', ['default' => false, 'comment' => '是否已批阅'])
            ->addColumn('create_time', 'integer', ['default' => 0])
            ->addColumn('update_time', 'integer', ['default' => 0])
            ->create();
    }
}
